import Vue from 'vue'
import VueResource from 'vue-resource'

import 'normalize.css/normalize.css'// A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import router from './router'
import store from './store'

import '@/icons' // iconf
import '@/permission' // permission control
import '@/utils/dialogDrag'

import * as filters from './filters' // global filters
import './mock'

import * as tools from './utils/tools' // global tools

Vue.use(VueResource)

Vue.use(ElementUI, {
  size: 'small',
  locale })

Vue.config.productionTip = false

// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

// 定义七牛上传域的全局变量
Vue.prototype.qiniuUrl = 'https://up-z2.qiniup.com'
// 全局证照类型数量
Vue.prototype.licNum = '10'

// 定义全局的方法类
Vue.prototype.tools = tools

new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
